package ltd.hxya.novel.book.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import ltd.hxya.novel.book.dto.HomeBookRespDto;
import ltd.hxya.novel.book.entity.Book;
import ltd.hxya.novel.book.dto.BookChapterRespDto;
import ltd.hxya.novel.book.entity.BookIndex;
import ltd.hxya.novel.book.utils.resp.RestResp;
import ltd.hxya.novel.common.bean.Result;
import ltd.hxya.novel.common.to.book.BookChapterTo;
import ltd.hxya.novel.common.vo.BookIndexVo;
import ltd.hxya.novel.common.vo.BookContentParam;
import ltd.hxya.novel.common.vo.PageParam;
import ltd.hxya.novel.common.vo.UserReadHistoryVo;
import ltd.hxya.novel.entity.rowdata.DataPart;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 小说目录表 服务类
 * </p>
 *
 * @author hxya
 * @since 2022-09-13
 */
public interface IBookIndexService extends IService<BookIndex> {

    List<BookIndexVo> bookIndex(String bookId, Integer sort);

    Map<Integer, String> nextAndPreIndexId(BookContentParam param);

    UserReadHistoryVo bookLastIndex(String bookId);

    List<BookChapterTo> saveBatchIndex(List<BookChapterTo> bookChapterTos);

    Page<BookIndex> indexList(String bookId, PageParam param);

    void changeIsVip(BookIndex bookIndex);

    void deleteIndecies(String bookId,String[] ids);

    void clearBookIndex(String bookId);

    List<BookIndex> saveIndex(List<DataPart> dataParts, Book book);

    Result<List<BookChapterRespDto>> getListChapter(String bookId);

    BookChapterRespDto getChapter(String lastChapterId);

    Long selectCount(QueryWrapper<BookIndex> indexQueryWrapper);

    BookIndex selectFirstBook(QueryWrapper<BookIndex> queryWrapper);

    BookIndex selectOne(QueryWrapper<BookIndex> queryWrapper);



}
